<template>
    <div class="content_card_item">
        <div class="card_item">
            <div class="cover_wrap">
                <div class="cover" style="cursor: pointer">
                    <span class="promotion" style="display: none">推荐</span
                    ><span class="origin_icon" style="display: none"></span>
                    <div
                        class="img"
                        style="
                            background-image: url('https://rs.dance365.com/photo/xxx_1561367854380_1561367848335.jpg?imageView2/0/w/300/h/1200/format/webp/ignore-error/1');
                        "
                    ></div>
                    <img
                        src="//rs.dance365.com/img/release_play@3x.fb313c4d.png"
                        alt="here is play btn icon"
                        class="play_icon"
                    />
                    <div class="subject_card">视频课</div>
                    <!----><!---->
                </div>
            </div>
            <div class="moment_detail">
                <div class="card_detail">
                    <div
                        title="古典舞基础元素组合《提、沉、冲靠、横移、旁提》芸门小娟原创"
                        class="title"
                        style="cursor: pointer"
                    >
                        <div class="example" data-ellipsis-id="381">
                            <a
                                href="/detail/video_course?momentId=db21550622ff41258efcfcd59f4a7963"
                                target="_blank"
                                class="differ-viewed ellipsis-content"
                                style="display: inline"
                                >古典舞基础元素组合《提、沉、冲靠、横移、旁提》芸门小娟…</a
                            >
                        </div>
                    </div>
                    <div class="viewCount">
                        <div class="price" style="line-height: 14px">
                            <div>
                                <span style="font-size: 14px">￥</span>
                                28.00
                            </div>
                        </div>
                        <span class="num"> 已报名:0 </span>
                    </div>

                    <div class="discover_location">
                        <div class="location">日期：<span style="color: rgb(85, 86, 96)">22/11/21~22/12/19</span></div>
                        <div>
                            <span>节数：</span>
                            <time style="color: rgb(85, 86, 96)">5</time>
                        </div>
                    </div>
                </div>
                <div class="creator_info">
                    <div class="left" style="max-width: 113px">
                        <div class="creator" iscertified="personal">
                            <div
                                class="avatar avatarClass notshowname"
                                style="
                                    background-image: url('https://rs.dance365.com/photo/1603647381021_CF1EA7C713BF4921AB7D252D7B1D1731?imageView2/0/w/100/h/100/format/webp/ignore-error/1');
                                "
                            >
                                <!---->
                            </div>
                            <div class="text_area">
                                <div class="first_line"></div>
                            </div>
                        </div>
                        <span title="芸门小娟" class="creator_name" style="max-width: 68px">芸门小娟</span
                        ><img
                            src="https://rs.dance365.com/authenticate_personal@3x.png"
                            class="certified_icon certified_icon not_overflow_title"
                            style="cursor: pointer"
                        />
                    </div>
                    <span title="2019年 06月 24日" class="uploadTime"
                        ><time datetime="1561374292376" class="uploadTime">19-06-24</time></span
                    >
                </div>
            </div>
        </div>
    </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
    name: "ContentCard",
});
</script>

<script setup lang="ts"></script>
<style scoped lang="less">
.content_card_item {
    &:not(:nth-child(5n)) {
        margin-right: 20px;
    }

    .card_item {
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        width: 224px;
        height: auto;
        margin-bottom: 20px;
        background-color: #fff;
        border-radius: 4px;

        .cover_wrap {
            height: 125.88px;

            .cover {
                position: relative;
                width: 100%;
                height: 100%;
                border-top-left-radius: 4px;
                border-top-right-radius: 4px;
                overflow: hidden;
                display: flex;
                align-items: center;
                justify-content: center;

                .promotion {
                    position: absolute;
                    right: -29px;
                    top: -20px;
                    font-size: 10px;
                    width: 70px;
                    height: 40px;
                    line-height: 65px;
                    display: inline-block;
                    background: #ff5e37;
                    color: #fff;
                    text-align: center;
                    box-shadow: 0 0 1px #662010;
                    transform: rotate(35deg);
                }

                .origin_icon {
                    position: absolute;
                    left: 5px;
                    top: 5px;
                    font-size: 10px;
                    width: 40px;
                    height: 22px;
                    line-height: 22px;
                    display: inline-block;
                    text-align: center;
                    background: url(https://rs.dance365.com/home_img_ycpc.png) no-repeat;
                    background-size: cover;
                }

                .img {
                    width: 100%;
                    height: 100%;
                    background-position: 50% center;
                    background-size: cover;
                }

                .play_icon {
                    position: absolute;
                    bottom: 6px;
                    left: 10px;
                    display: inline-block;
                    width: 30px;
                    height: 30px;
                }
            }
        }

        .moment_detail {
            width: 100%;
            color: #b1b5c1;
            height: 155px;

            .card_detail {
                padding-right: 10px;
                padding-left: 10px;
                padding-bottom: 13px;
                border-bottom: 1px solid #ebeced;
                height: 90px;

                .title {
                    font-size: 14px;
                    color: #111;
                    padding-top: 10px;
                    padding-bottom: 0;
                    line-height: 18px;
                    height: 35px;
                    width: 100%;
                }

                .viewCount {
                    font-size: 12px;
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    height: 32px;
                    line-height: 32px;

                    &.isVipFreeCustom {
                        height: 22px;
                        line-height: 22px;
                        padding-bottom: 7px;
                    }

                    .price {
                        color: #f93684;
                        font-size: 16px;
                        transform: translateY(-2px);
                    }

                    .num {
                        word-break: keep-all;
                    }
                }

                .discover_location {
                    font-size: 12px;
                    color: #b1b5c1;
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    height: 32px;
                    line-height: 32px;

                    .location {
                        color: #b1b5c1;
                        word-break: keep-all;
                    }
                }
            }

            .creator_info {
                box-sizing: border-box;
                display: -webkit-box;
                display: -ms-flexbox;
                display: flex;
                align-items: center;
                justify-content: space-between;
                height: 50px;
                padding-left: 16px;
                position: relative;
                font-size: 12px;

                .left {
                    display: flex;
                    align-items: center;
                }

                .uploadTime {
                    padding-right: 8px;
                    transform: translateY(1px);
                }

                .avatarClass {
                    width: 24px;
                    height: 24px;
                }
            }
        }
    }

    .subject_card {
        position: absolute;
        color: #fff;
        right: 10px;
        bottom: 10px;
        font-size: 12px;
        height: 24px;
        line-height: 24px;
        padding: 0 10px;
        border-radius: 12px;
        background: rgba(0, 0, 0, 0.6);
    }
}

/* other */
.differ-viewed {
    color: inherit;
    text-decoration: none;
    word-break: break-all;
}

a {
    background-color: transparent;
}

.creator {
    .avatar {
        position: relative;
        flex-shrink: 0;
        border-radius: 50%;
        background-size: cover;
        background-position: 50%;

        &.notshowname {
            margin-right: 0;
        }
    }

    .text_area {
        display: flex;
        flex-direction: column;
    }

    .first_line {
        display: flex;
        align-items: center;
    }
}

.creator_name {
    color: #111;
    cursor: pointer;
    margin-left: 8px;
    max-width: 68px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.certified_icon {
    width: 12px;
    height: 12px;
    margin-left: 4px;
}

img {
    border-style: none;
}
</style>
